home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
comm2
/
statty25.lha
/
statty
/
logspotxport
/
logspotxport.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1996-04-29
|
2KB
|
98 lines
/*
** $VER: logspotxport.rexx 0.2 (29.4.96) Rolf Rotvel
**
** Uses rexxtricks.library
*/
log = 'logs:spot.log.max' /* Spot logfile */
areas = 'mail:max/spot.areas' /* Spot areafile */
/*
** End cfg.
*/
call addlib('rexxsupport.library', 0, -30, 0)
call addlib('rexxtricks.library', 0, -30, 0)
packer = arg(1)
if packer = '' then exit 10
wds = words(packer)
fromfile = dequote(word(packer, wds))
if ~exists(fromfile) then exit 10
tofile = dequote(word(packer, wds - 1))
crlf = '0d'x
nl = '0a'x
sz = word(statef(fromfile), 2)
call open('pkt', fromfile, 'r')
do l = 1 to (sz % 65535) + 1
line.l = readch('pkt', 65535)
end
call close('pkt')
line.0 = l - 1
num = 1
do l = 1 to line.0
do forever
parse var line.l start 'AREA:' areaname (crlf) line.l
if line.l = '' then leave
chk = lsearch(areaname, area.name)
if chk = -1 then do
area.name.num = areaname
area.msgs.num = 1
area.name.0 = num
num = num + 1
end
else area.msgs.chk = area.msgs.chk + 1
end
end
area.name.0 = num - 1
if area.name.0 > 0 then do
if ~readfile(areas, arealine) then exit 10
l = 1
logline.l = getlogline('|', 'Export startet')
do a = 1 to area.name.0
if area.msgs.a = 1 then msg = 'message'
else msg = 'messages'
chk = lsearch('*"'||area.name.a||'"*', arealine,,, 'p')
if chk ~= -1 then parse var arealine.chk '"' . '"' '"' area.name.a '"'
l = l + 1
logline.l = getlogline('!', "Area '"||area.name.a||"' got "||area.msgs.a||" "||msg)
end
l = l + 1
logline.l = getlogline('|', 'Export ended'||nl)
logline.0 = l
if exists(log) then call writefile(log, logline, 'a')
else call writefile(log, logline)
end
address command packer
exit
DEQUOTE: procedure
str = arg(1)
parse var str '"' unq '"'
if unq = '' then return str
return unq
GETLOGLINE: procedure
parse arg pre, msg
pre = pre||' '
parse value date() with dd mmm yyyy .
date = dd||'-'||mmm||'-'||right(yyyy, 2)||' '||time()||' '
return pre||date||msg